<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<button @click="num++">增加</button><br/>
    <button @click="decrement">减少</button><br/>
<h1>num:{{num}}</h1>


</div>
<script>
   var  dataobj={
       name:"柯震南",
           num:0
   }



    var vm = new Vue({
        el:"#app",
       data:dataobj,
        methods:{
            decrement(){
                this.num--;
            }
        }




    })

</script>


</body>
</html>